This is an R Markdown Notebook. When you execute code within the notebook, the results appear beneath the code.
When you save the notebook, an HTML file containing the code and output will be saved alongside it (click the Preview button or press Cmd+Shift+K to preview the HTML file).
The preview shows you a rendered HTML copy of the contents of the editor. Consequently, unlike Knit, Preview does not run any R code chunks. Instead, the output of the chunk when it was last run in the editor is displayed.
You can write HTML (and for instance embed a Google Form)
library(gsheet)
library(tidyverse)
Registered S3 methods overwritten by 'dbplyr':
method from
print.tbl_lazy
print.tbl_sql
── Attaching packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.1 ──
✓ ggplot2 3.3.5 ✓ purrr 0.3.4
✓ tibble 3.1.3 ✓ dplyr 1.0.7
✓ tidyr 1.1.3 ✓ stringr 1.4.0
✓ readr 2.0.1 ✓ forcats 0.5.1
── Conflicts ──────────────────────────────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
x dplyr::filter() masks stats::filter()
x dplyr::lag() masks stats::lag()
library(quanteda)
Package version: 3.1.0
Unicode version: 13.0
ICU version: 69.1
Parallel computing: 16 of 16 threads used.
See https://quanteda.io for tutorials and examples.
library(ggplot2)
library(plotly)
Registered S3 method overwritten by 'data.table':
method from
print.data.table
Registered S3 method overwritten by 'htmlwidgets':
method from
print.htmlwidget tools:rstudio
Attaching package: ‘plotly’
The following object is masked from ‘package:ggplot2’:
last_plot
The following object is masked from ‘package:stats’:
filter
The following object is masked from ‘package:graphics’:
layout
url <- "https://docs.google.com/spreadsheets/d/1qmbPdvspf9Vg_Eab9fT34ubudF_vklJwKxf0UuJrHvw/edit?usp=sharing"
rawDF <- gsheet2tbl(url)
nameVec <- c("time", "github", "languages", "proficiency")
colnames(rawDF) <- nameVec
summary(rawDF)
time github languages proficiency
Length:2 Length:2 Length:2 Min. :3.00
Class :character Class :character Class :character 1st Qu.:3.25
Mode :character Mode :character Mode :character Median :3.50
Mean :3.50
3rd Qu.:3.75
Max. :4.00
head(rawDF)
languages <- as.character(rawDF$languages) %>% corpus
summary(languages)
Corpus consisting of 2 documents, showing 2 documents:
Text Types Tokens Sentences
text1 6 9 1
text2 3 3 1
dfm <- tokens(languages) %>%
dfm %>% convert(to="data.frame") %>%
select(!contains(",")) %>%
summarise(across(where(is.numeric), ~ sum(.x, na.rm = TRUE))) %>%
pivot_longer(everything(), names_to = "language", values_to = "count")
dfm
proficiency <- table(rawDF$proficiency)
barplot(proficiency,
xlab="Proficiency Score", ylab="Score Count", col="red")
p1 <- ggplot(dfm) +
aes(x=language, y=count, fill=language) +
geom_col()
p1
ggplotly(p1)